package day3


abstract  class aperson(val name:String){
  def syshello:Unit
}

class astudent(name:String, val sex:String) extends  aperson(name){
  def syshello: Unit = {
    println("hello astudent"+name +"\t" + sex)
  }
}

class Person1{
  private var name = "leo"
  def getName() = name
}

class Student1 extends Person1{
  private  var score = "A"
  def getScore() = score

  override def getName(): String = {
    println("Student1 class")
    super.getName()
  }

}

object InheritClass {
  def main(args: Array[String]): Unit = {
    val s = new Student1()
    println(s.getName)
    println(s.getScore)

    val student = new astudent("stu", sex = "nan")
    student.syshello

  }
}
